for i in range(1,1000000008):
    if (2021*i)%1000000007==999999999:
        print(i)
        break